$$.Server.IO = (function(){
	/**
	 * @overrided
	 */
	function findById(tagLibs, authority, id){
		var  
	     data	 = this.findById(id)
		,content = tagLibs.renderContentPanel(data)
		,header  = tagLibs.renderHead({
			isEditMode: authority.isEditMode()
		})
		,body	 = tagLibs.renderBody(content);
		
		this.content = $$.tags.Html.format(header, body);
	}
	
	/**
	 * @overrided
	 */
	function findPage(tagLibs, authority){
		var 
		 start	  = Number(Request.QueryString('start')())			// Number
		,findPage = this.findPage(start)							// Array
		,data	  = findPage[0]										// JSON
		,page	  = findPage[1]										// Object
		,header	  = tagLibs.renderHead({
			isEditMode: authority.isEditMode()
		})															// String
																	// String
		,body	  = tagLibs.renderBody(tagLibs.renderRecordSet(data, null, '新闻') + page.html);
	    
	    this.content = $$.tags.Html.format(header, body); 
	}
	return {
		HTTPInterface : function(tagLibs, authority){
			var 
		     id 	= Request('id')()
		    ,action = Request('action')()
			
			// printout contentPanel
			if(id && !action){
				findById.call(this, tagLibs, authority, id);
			}if(id && action){
				switch(action.toUpperCase()){
					case $$.data.CREATE:
						
					break;
					case $$.data.UPDATE:
						var entity = this.findById(id);
						entity.state = $$.data.Entity.updateState;
						this.content = $$.JSON.encode(entity);
					break;
					case $$.data.DELETE:
						
					break;
				}
			// 列记录
			}if(!id && !action){
				findPage.apply(this, arguments);
			}
			
		    this.DAO.close();
		}
		
		/**
		 * 输出到客户端的HTML内容。
		 * @property {String}
		 */
		,content: null
	};
})();